SCRIPTPATH=`dirname $0`

echo "CRVClient started..."
echo "SCRIPTPATH=$SCRIPTPATH"

echo "doing yum update"
#yum -y update

echo "sync time"
ntpd -q -g -D 9

sh $SCRIPTPATH/setuphostname.sh

python $SCRIPTPATH/setupCRVClient.py $SCRIPTPATH/values.pickle $SCRIPTPATH/crvclient.pickle $SCRIPTPATH

#Tell CloudCRV that I'm started, prepare the next steps for me
python $SCRIPTPATH/setStarted.py $SCRIPTPATH/crvclient.pickle

#run puppet
rm -frv /etc/puppet/puppet.conf
python $SCRIPTPATH/runpuppetdaemon.py $SCRIPTPATH/crvclient.pickle
#python $SCRIPTPATH/startupPuppet.py $SCRIPTPATH/crvclient.pickle
